package com.xiaoma.beanpostprocessor;

import lombok.SneakyThrows;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.stereotype.Component;

/**
 * <p>Title: LoggingBeanPostProcessor </p>
 * <p>Description：描述 </p>
 * <p>Package:com.xiaoma.beanpostprocessor </p>
 * Copyright: Copyright(c) 2020 Travelsky All Rights Reserved Company: Travelsky Software: AIC Date: 2021/2/24 14:36
 *
 * @author maj
 * @version 1.0.0
 */
@Component
public class LoggingBeanPostProcessor implements BeanPostProcessor {

  MyRegistry registry=new MyRegistry();



  @Override
  public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
    return bean;
  }

  @SneakyThrows
  @Override
  public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
    registry.afterPropertiesSet();

    return bean;
  }


}
